{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Checkout my [Twitter(@rohanpaul_ai)](https://twitter.com/rohanpaul_ai) for daily LLM bits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## LlaMa-2-FineTuning on any of your custom dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install trl[peft]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# From source. For running the examples in the repository\n",
    "# Clone the repository and install it with pip:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git clone https://github.com/lvwerra/trl.git\n",
    "\n",
    "!cd trl/\n",
    "\n",
    "! pip install ."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```py\n",
    "!python examples/scripts/sft_trainer.py \\\n",
    "  --model_name meta-llama/Llama-2-7b-hf \\\n",
    "  --dataset_name timdettmers/openassistant-guanaco \\\n",
    "  --load_in_4bit \\\n",
    "  --use_peft \\\n",
    "  --batch_size 4 \\\n",
    "  --gradient_accumulation_steps 2\n",
    "\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
